

DELETE FROM TBL_ACCOUNT_PLANNING_FINANCE

INSERT TBL_ACCOUNT_PLANNING_FINANCE
select * from [SERVER12].[SMECUSTOMER360].DBO.TBL_ACCOUNT_PLANNING_FINANCE

INSERT TBL_ACCOUNT_PLANNING_FINANCE
	SELECT CRITERIA, 0,0, 0,0,0,0,0,0,0,0,0,0,0,0, B.CIF, NULL, NULL, 0, DATA_TYPE,ORDER_NUM, GROUP_CRI, GROUP_ROW
	FROM TBL_ACCOUNT_PLANNING_CRITERIA AS A, TBL_ACCOUNT_PLANNING AS B WHERE A.CRI_TYPE=2 and b.CIF not in (select cif from TBL_ACCOUNT_PLANNING_FINANCE)
	ORDER BY CIF
	
SELECT * FROM TBL_ACCOUNT_PLANNING_FINANCE_RESULT

--DELETE FROM TBL_ACCOUNT_PLANNING_FINANCE_RESULT

--INSERT TBL_ACCOUNT_PLANNING_FINANCE_RESULT
--	SELECT * FROM TBL_ACCOUNT_PLANNING_FINANCE